#include "Shared.h"

samplerCUBE unit0 : register( s1 );

void vsFunction(in vsGeometryIn vertex, out vsGeometryOut result)
{
	vertex.position0.w = 1;
	vertex.position0 *= 5;
	
    float4x4 fixedView = View;
    fixedView[3].xyz = 0;
    
    float4 viewPosition = mul(vertex.position0, fixedView);
    result.positionSys = mul(viewPosition, Projection);
    result.position0 = vertex.position0;
	result.normal0 = 0;
	result.color0 = 0;
	result.uv0 = 0;
	result.uv1 = 0;
}


void psFunction(psGeometryIn pixel, out float4 color : COLOR0)
{
	color = texCUBE(unit0, (float3)pixel.position0);
	color.w = 1;
}

technique t0
{
    pass p0
    {
        VertexShader = compile vs_2_0 vsFunction();
        PixelShader = compile ps_2_0 psFunction();
    }
}
